package com.example.common.exception;

import com.example.common.core.Result;
import com.example.common.core.ResultGenerator;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class ResultExceptionHandler {
    @ExceptionHandler(Exception.class)
    public Result handleException(Exception e){
        return ResultGenerator.genFailResult(e.getMessage());
    }
}
